package com.nowcoder.code.lcof;

public class JZ15 {

    public static void main(String[] args) {

        System.out.println(new JZ15().NumberOf1(-1));
    }

    public int NumberOf1(int n) {

        int sum = 0;
        int one = 1;

        for (int i = 0; i < 32; i++) {
            if ((one & n) == 1) {
                sum++;
            }
            n = n >> 1;
        }
        return sum;
    }
}
